package com.strategy.game.case2;

/**
 * @ClassName: Role
 * @Description:
 * @Author Fly
 * @Date 2022/12/13 15:58
 */
public abstract class Role {

    protected String name;
    protected SkinBehavior skinBehavior;
    protected SkillBehavior skillBehavior;
    protected RunBehavior runBehavior;

    public Role setSkinBehavior(SkinBehavior skinBehavior) {
        this.skinBehavior = skinBehavior;
        return this;
    }

    public Role setSkillBehavior(SkillBehavior skillBehavior) {
        this.skillBehavior = skillBehavior;
        return this;
    }

    public Role setRunBehavior(RunBehavior runBehavior) {
        this.runBehavior = runBehavior;
        return this;
    }

    protected void skin() {
        skinBehavior.skin();
    }

    protected void skill() {
        skillBehavior.skill();
    }

    protected void run() {
        runBehavior.run();
    }

}
